package com.example.tests;

public class ContactData implements Comparable<ContactData>{

	public String firstName;
	public String lastName;
	public String address;
	public String homePhone;
	public String mobilePhone;
	public String work;
	public String email;
	public String email2;
	public String address2;
	public String phone2;
	public String byear;
	public String bday;
	public String bmonth;
	public String group;

	public ContactData() {
		
	}
	public ContactData(String firstName,String lastName,String address,
	String homePhone, String mobilePhone,String work,
	String email,String email2,String address2,
	String phone2,String byear,String bday,String bmonth,String group)
	{
		this.firstName = firstName;
		this.lastName = lastName;
		this.address = address;
		this.homePhone = homePhone;
		this.mobilePhone = mobilePhone;
		this.work = work;
		this.email = email;
		this.email2 = email2;
		this.address2 = address2;
		this.phone2 = phone2;
		this.byear = byear;
		this.bday = bday;
		this.bmonth = bmonth;
		this.group = group;
		
	}

 @Override
 public String toString() {
	return "ContactData [firstName=" + firstName + ", lastName=" + lastName
			+ ", address=" + address + ", homePhone=" + homePhone
			+ ", mobilePhone=" + mobilePhone + ", work=" + work
			+ ", email=" + email + ", email2=" + email2 + ", address2="
			+ address2 + ", phone2=" + phone2 + ", byear=" + byear
			+ ", bday=" + bday + ", bmonth=" + bmonth + ", group=" + group
			+ "]";
 }


@Override
public int hashCode() {
	final int prime = 31;
	int result = 1;
	result = prime * result + ((lastName == null) ? 0 : lastName.hashCode());
	return result;
}
@Override
public boolean equals(Object obj) {
	if (this == obj)
		return true;
	if (obj == null)
		return false;
	if (getClass() != obj.getClass())
		return false;
	ContactData other = (ContactData) obj;
	if (lastName == null) {
		if (other.lastName != null)
			return false;
	} else if (!lastName.equals(other.lastName))
		return false;
	return true;
}
@Override
public int compareTo(ContactData other) {
	 
			return this.lastName.toLowerCase().compareTo(other.lastName.toLowerCase());
			  }
	        
}
